import time

import pytest
from selenium import webdriver
from selenium.webdriver.common.by import By
from time import sleep
driver = webdriver.Firefox()
driver.get('https://www.jd.com/')
time.sleep(3)
driver.find_element(By.TAG_NAME,'input').send_keys('手机')
time.sleep(5)


# driver.find_element(By.XPATH,'//*[@id="s-top-left"]/a[1]').click()
# driver.switch_to.window(driver.window_handles[-1])
# time.sleep(2)
# driver.find_element(By.LINK_TEXT,'改写人类现代化进程').click()
# time.sleep(5)
# driver.find_element(By.LINK_TEXT,'帮助')
# driver.find_element(By.XPATH,'//*[@id="searchForm"]/div[1]/input').send_keys('音乐耳机')
# time.sleep(5)
# driver.find_element(By.XPATH,'//*[@id="searchForm"]/div[2]/input').click()
# time.sleep(5)
# driver.quit()

# time.sleep(20)
# driver.find_element(By.ID,'kw').send_keys('小米su7')
# time.sleep(5)
# driver.find_element(By.ID,'su').click()
# time.sleep(5)

# time.sleep(3)
# driver.find_element(By.CLASS_NAME,'search-input').send_keys('音乐耳机')
# time.sleep(5)
# driver.find_element(By.CLASS_NAME,'search-input-btn').click()
# time,sleep(5)
# #节点断言
# dy1=driver.find_element(By.XPATH,'/html/body/div[4]/a[2]').text
# print(dy1)
# time.sleep(3)
# driver.find_element(By.ID,'store_nums').clear()
# driver.find_element(By.ID,'store_nums').send_keys('2')
# time.sleep(3)

# time.sleep(3)
# driver.find_element(By.XPATH,'/html/body/div[1]/div/div[2]/ul/li[1]/a').click()
# time.sleep(2)
# driver.find_element(By.CLASS_NAME,'reg-new').click()
# time.sleep(2)
# driver.find_element(By.NAME,'username').send_keys('13311033962')
# time.sleep(2)
# driver.find_element(By.NAME,'password').send_keys('123456')
# time.sleep(10)
# driver.find_element(By.CLASS_NAME,'finish-btn').click()
# time.sleep(3)


# time.sleep(3)
# driver.find_element(By.XPATH,'//*[@id="hotsearch-content-wrapper"]/li[1]/a/span[2]').click()
# time.sleep(3)
# tzdy=driver.find_element(By.XPATH,'//*[@id="1"]/div/div/div/div/div/div[2]/h3/a/span/em').text
# print(tzdy)
# time.sleep(3)
#

